package com.garlic.face.jlf.ui;

import android.app.DialogFragment;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.garlic.face.jlf.R;
import com.garlic.face.jlf.transaction.constances.JLFConstant;

/*
public class WeightDialog extends DialogFragment implements View.OnClickListener {

    private static volatile WeightDialog weightDialog = null;
    private String type;
    private String weightMsg;
    private TextView weight_msg;
    private TextView weight_title;
    private TextView weight_content;

    public void setCallBack(CallBack callBack) {
        this.callBack = callBack;
    }

    private CallBack callBack;

    public static WeightDialog getInstance(String type, String weightMsg){
        if(null == weightDialog){
            synchronized (WeightDialog.class){
                if(null == weightDialog){
                    weightDialog=new WeightDialog();
                    Bundle bundle=new Bundle();
                    bundle.putString("type",type);
                    bundle.putString("weightMsg",weightMsg);
                    weightDialog.setArguments(bundle);
                }
            }
        }
        return weightDialog;
    }
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
          type=getArguments().getString("type");
          weightMsg=getArguments().getString("weightMsg");
        }
    }

    public void setContent(String type){
        switch (type){
            case JLFConstant.WEIGHT_START_VERIFY:
                weight_title.setText(JLFConstant.VERIFY_TITLE);
                weight_content.setText(JLFConstant.VERIFY_CONTENT);
                break;
            case JLFConstant.WEIGHT_BAG_DLG:
                weight_title.setText(JLFConstant.BAG_TITLE);
                weight_content.setText(JLFConstant.BAG_CONTENT);
                break;
            case JLFConstant.WEIGHT_UNEXCEPTED_DLG:
                weight_title.setText(JLFConstant.UNEXCEPTED_TITLE);
                weight_content.setText(JLFConstant.UNEXCEPTED_CONTENT);
                break;
            case JLFConstant.WEIGHT_OVER_DLG:
                weight_title.setText(JLFConstant.OVER_TITLE);
                weight_content.setText(JLFConstant.OVER_CONTENT);
                break;
            case JLFConstant.WEIGHT_LOW_DLG:
                weight_title.setText(JLFConstant.LOW_TITLE);
                weight_content.setText(JLFConstant.LOW_CONTENT);
                break;
            case JLFConstant.WEIGHT_CANCEL_LOW:
                weight_title.setText(JLFConstant.CANCEL_LOW_TITLE);
                weight_content.setText(JLFConstant.CANCEL_LOW_CONTENT);
                break;
            case JLFConstant.WEIGHT_CANCEL_OVER:
                weight_title.setText(JLFConstant.CANCEL_OVER_TITLE);
                weight_content.setText(JLFConstant.CANCEL_OVER_CONTENT);
                break;
                default:
                    break;
        }
    }

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view;
        view=inflater.inflate(R.layout.popup_window_weight,container,false);
        FrameLayout frameLayout = view.findViewById(R.id.popup_window_weight_layout);
        weight_title=view.findViewById(R.id.popup_window_weight_title);
        weight_content=view.findViewById(R.id.popup_window_weight_content);
        setContent(type);
        weight_msg = view.findViewById(R.id.popup_window_weightmsg);
        weight_msg.setText(weightMsg);
        Button btn_help=view.findViewById(R.id.popup_window_weight_help);
        ImageView btn_admin = view.findViewById(R.id.popup_window_weight_admin);
        frameLayout.setOnClickListener(this);
        btn_help.setOnClickListener(this);
        btn_admin.setOnClickListener(this);
        return view;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.popup_window_weight_layout:
                break;
            case R.id.popup_window_weight_help:
                callBack.helpClick(view);
                break;
            case R.id.popup_window_weight_admin:
                callBack.adminClick(view);
                break;
                default:
                    break;
        }
    }

    public  interface CallBack{
        void adminClick(View view);
        void helpClick(View view);
    }
}
*/
